//
//  RPCCenter.swift
//  Center_RPC
//
//  Created by 蒋晨成 on 2021/12/28.
//

import Foundation
import Standard

public enum RPCCenter {}

extension RPCCenter: Centric {
    public static let queue: DispatchQueue = .init(label: typeName, attributes: .concurrent)
}

public extension RPCCenter {
    static func register(azirContext: AzirRPCServiceContextual) {
        self.azirContext = azirContext
    }

    static let azir = AzirRPCService(context: azirContext, requestQueue: queue, resultQueue: mainQueue)
}

extension RPCCenter {
    @DelayInit
    private(set) static var azirContext: AzirRPCServiceContextual
}
